﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;
using BEX.Core.Exchange.MtGox.MtGoxResponseJsonTypes;

namespace BEX.Core.Exchange.MtGox
{
    public class MtGoxResponse
    {
        public MtGoxResponse(string json)
            : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public MtGoxResponse(JObject obj)
        {
            this.__jobject = obj;
        }

        public string result
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "result"));
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Data _data;
        public Data data
        {
            get
            {
                if (_data == null)
                {
                    _data = JsonClassHelper.ReadStronglyTypedObject<Data>(JsonClassHelper.GetJToken<JObject>(__jobject, "data"));
                }
                return _data;
            }
        }
    }
}
